package com.molichuxing.property;

import com.molichuxing.services.property.GoodsBuyBackEnum;

/**
 * 是否回购
 * The enum Buy back enum.
 * @author whl
 */
public enum BuyBackEnum {

    NO(0, "不回购"),YES(1, "回购");

    int value;
    String name;

    BuyBackEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    /**
     * 通过value获取枚举的name
     * @param value
     * @return
     */
    public static BuyBackEnum getName(int value) {
        for (BuyBackEnum orderSource : BuyBackEnum.values()) {
            if (orderSource.getValue() == value) {
                return orderSource;
            }
        }
        return null;
    }
}
